package com.bjfu.intelligentrecognizeserver.pojo.entity;

public class FileUploadInfo {
    private  int totalChunks;
    private final boolean[] uploadedChunks;

    public FileUploadInfo(int totalChunks) {
        this.totalChunks = totalChunks;
        this.uploadedChunks = new boolean[totalChunks];
    }

    public void markChunkUploaded(int chunkNumber) {
        uploadedChunks[chunkNumber - 1] = true;
    }

    public boolean allChunksUploaded() {
        for (boolean uploaded : uploadedChunks) {
            if (!uploaded) {
                return false;
            }
        }
        return true;
    }
}
